/*
*
 * @author: Joseph Conrad Stack
 * 
 * Program 6:
 * This program emulates the unix command wc.  Given a file name
 * it computes the number of words and number of characters.
 */ 


#ifndef WCOUNT_H
#define WCOUNT_H

#include <stdio.h>
#include <stdlib.h>

/*
*
 * purpose: get a filename from the user
 * parameters: none
 * returns: a pointer to the name of the file the user inputed
 * side-effects: none expected
 * sample-call: getFileName() ->in.txt returns in.txt as filename
 */ 
char* getFileName();

/*
*
 * purpose: to open the file gotten from user input
 * parameters: filename is the name of the file to open
 * returns: 1 if the file could be opened, 0 if file couldn't be opened
 * side-effects: none expected
 * sample-call: openFile(filename), where filename is a pointer to a valid file, returns 1
 */ 
int openFile(char* filename);

/*
*
 * purpose: counts the number of words,characters in the opened file
 * parameters: none
 * returns: nothing, but sets two global count variables
 * side-effects: none expected
 * sample-call: countWords(), if file is the given test file from the specs:
 *              then wordcount = 24 and charcount = 115
 */ 
void countWords();

/*
*
 * purpose: to print the results of the counting
 * parameters: none
 * returns: nothing
 * side-effects: none expected
 * sample-call: countWords(), if file is the given test file from the specs:
 *              to stdout:                           neta
 *              Number of characters: 115
 *              Number of words: 24
 */ 
 
void showResults();

/*
*
 * purpose: closes the file that was opened
 * parameters: none
 * returns: nothing
 * side-effects: none
 * sample-call: closefile() closes the global FILE*
 */ 
void closeFile();


/*
*
 * purpose: starts the program
 * parameters: none
 * returns: EXIT_SUCCESS if program was run successfully, EXIT_FAILURE if program wasn't run completely
 * side-effects: none
 * sample-call: 
 */ 

int main();
#endif
